/*
 * @Author: Tyler
 * @Date: 2025-10-13 17:06:22
 * @Description: 
 * Copyright (c) 2025 by User/Corp, All Rights Reserved.
 */
#ifndef LAYER_MANAGER_H
#define LAYER_MANAGER_H

#include "Layer.h"
#include <memory>
#include <unordered_map>

using namespace std;

class LayerManager {
public:
    LayerManager() {}
    LayerManager(const LayerManager&) = delete;
    LayerManager& operator=(const LayerManager&) = delete;

    static LayerManager& getInstance();
    void addLayer(const shared_ptr<Layer>& layer);
    shared_ptr<Layer> getLayerByIndex(int layerIndex);
    int getNumLayers() const;
    void connectLayers();
    void clear();

private:
    unordered_map<int, shared_ptr<Layer> > layers;
};

#endif // LAYER_MANAGER_H
